package com.btpn.custody.dao;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.springframework.dao.DataAccessException;

import com.btpn.custody.entity.Account;
import com.btpn.custody.web.m003.model.Report03Model;

public interface IAccount {
	/* =================================================== B A S I C ==================================================== */
	Account get(Long id);
	
	List<Account> findAll();
	
	Integer getCount();
	
	Serializable create(Account account) throws DataAccessException;
	
	void createOrUpdate(Account account);
	
	Account update(Account account);
	
	void delete(Long id);
	
	/* =================================================== C U S T O M ================================================== */

	Account getByCifAccountSufix(String cif, String account, String sufix);
	
	List<Account> findAllByDateRange(Date from, Date to);
	List<Account> findByAreaDateRange(Long areaId, Date from, Date to);
	List<Account> findByBranchDateRange(Long branchId, Date from, Date to);
	
	List<Account> findAllCloseByDateRange(Date from, Date to);
	List<Account> findCloseByAreaDateRange(Long areaId, Date from, Date to);
	List<Account> findCloseByBranchDateRange(Long branchId, Date from, Date to);
	
	List<Report03Model> findByDateRangeByModel(String from, String to);
	List<Report03Model> findByAreaDateRangeByModel(Long areaId, String from, String to);
	List<Report03Model> findByBranchDateRangeByModel(Long branchId, String from, String to);
	
	// use at Jasper02 : area 
	Long countForAccuracyMasterSLA(Long areaId, String status, Integer month, Integer year);
	
	// use at Jasper02 : branch
	Long countForAccuracyDetailSLA(Long branchId, String status, Integer month, Integer year);
	
	// use at Jasper02 : all
	Long countForAccuracyAllSLA(String status, Integer month, Integer year);

	
}
